<script setup>
import WelcomeSection from '../components/WelcomeSection.vue'
</script>

<template>
  <main class="home-page">
    <!-- 顶部横幅 -->
    <div class="hero-banner">
      <div class="banner-content">
        <h1>发现你的完美宠物伙伴</h1>
        <p>探索各种可爱宠物品种，找到最适合你的毛孩子</p>
        <router-link to="/breeds" class="banner-button">浏览品种</router-link>
      </div>
      <div class="banner-image">
        <img src="@/assets/3.png" alt="可爱宠物们" />
      </div>
    </div>

    <!-- 宠物品种展示区 -->
    <section class="breeds-showcase">
      <h2>热门宠物品种</h2>
      <div class="breeds-grid">
        <div class="breed-card">
          <img src="@/assets/1.png" alt="猫咪品种" />
          <div class="breed-info">
            <h3>猫咪家族</h3>
            <p>探索各种性格迥异的猫咪品种</p>
            <a href="/breeds/cats" class="breed-link">了解更多</a>
          </div>
        </div>

        <div class="breed-card">
          <img src="@/assets/2.png" alt="狗狗品种" />
          <div class="breed-info">
            <h3>狗狗乐园</h3>
            <p>发现忠诚可爱的狗狗品种</p>
            <a href="/breeds/dogs" class="breed-link">了解更多</a>
          </div>
        </div>

        <div class="breed-card">
          <img src="@/assets/Hero.png" alt="小型宠物" />
          <div class="breed-info">
            <h3>小型宠物</h3>
            <p>探索兔子、仓鼠等小型宠物</p>
            <a href="/breeds/small-pets" class="breed-link">了解更多</a>
          </div>
        </div>
      </div>
    </section>

    <!-- 养宠指南区域 -->
    <section class="pet-guides">
      <h2>专业养宠指南</h2>
      <div class="guides-grid">
        <div class="guide-card">
          <img src="@/assets/1.png" alt="猫咪指南" />
          <div class="guide-info">
            <h3>猫咪饲养指南</h3>
            <p>从幼猫到成年猫的全面护理知识</p>
            <a href="/care/cats" class="breed-link">查看指南</a>
          </div>
        </div>
        
        <div class="guide-card">
          <img src="@/assets/2.png" alt="狗狗指南" />
          <div class="guide-info">
            <h3>狗狗训练技巧</h3>
            <p>基础服从训练到高级技能培养</p>
            <a href="/training/dogs" class="breed-link">查看指南</a>
          </div>
        </div>
        
        <div class="guide-card">
          <img src="@/assets/Hero.png" alt="小型宠物指南" />
          <div class="guide-info">
            <h3>小兔子饲养</h3>
            <p>兔子的饮食、住所和健康护理</p>
            <a href="/care/small-pets/rabbits" class="breed-link">查看指南</a>
          </div>
        </div>
      </div>
    </section>

    <!-- 宠物故事专栏 -->
    <section class="pet-stories">
      <div class="stories-header">
        <h2>宠物暖心故事</h2>
        <a href="/stories" class="view-all">查看全部故事</a>
      </div>
      
      <div class="stories-grid">
        <div class="story-card">
          <div class="story-image">
            <img src="@/assets/1.png" alt="猫咪故事" />
          </div>
          <div class="story-content">
            <h3>流浪小猫的重生记</h3>
            <p class="story-excerpt">一只被遗弃的小猫如何在新家庭中找到幸福...</p>
            <div class="story-meta">
              <span class="story-date">2023-09-15</span>
              <span class="story-author">by 李小姐</span>
            </div>
          </div>
        </div>
        
        <div class="story-card">
          <div class="story-image">
            <img src="@/assets/2.png" alt="狗狗故事" />
          </div>
          <div class="story-content">
            <h3>搜救犬的日常训练</h3>
            <p class="story-excerpt">揭秘工作犬如何接受专业训练成为英雄...</p>
            <div class="story-meta">
              <span class="story-date">2023-09-10</span>
              <span class="story-author">by 王教练</span>
            </div>
          </div>
        </div>
      </div>
    </section>

    <!-- 像素风格宠物展示区 -->
    <section class="pixel-pets-showcase">
      <h2>可爱像素宠物画廊</h2>
      <div class="pixel-gallery-wrapper">
        <div class="pixel-gallery">
          <div class="pixel-item">
            <img src="@/assets/pixel-cats.png" alt="猫咪一家" />
            <p class="pixel-caption">猫咪一家的温馨时刻</p>
          </div>
          
          <div class="pixel-item">
            <img src="@/assets/pixel-pets.png" alt="宠物朋友们" />
            <p class="pixel-caption">各种可爱宠物的像素聚会</p>
          </div>
        </div>
        
        <div class="scroll-hint">
          <p>💡 用鼠标滑动浏览更多可爱宠物</p>
        </div>
      </div>
    </section>

    <!-- 宠物档案管理 -->
    <section class="pet-profile">
      <div class="profile-content">
        <div class="profile-text">
          <h2>创建你的宠物电子档案</h2>
          <p>记录宠物的成长历程、医疗信息和日常生活，随时查看和管理，让养宠更轻松！</p>
          <ul class="profile-features">
            <li>🐾 健康记录追踪</li>
            <li>📅 疫苗接种提醒</li>
            <li>📸 成长照片墙</li>
            <li>📝 个性档案卡</li>
          </ul>
          <a href="/profile/pet" class="banner-button">开始创建</a>
        </div>
        <div class="profile-image">
          <img src="@/assets/2.png" alt="宠物档案管理" />
        </div>
      </div>
    </section>

    <!-- 宠物动态分享 -->
    <section class="pet-social">
      <h2>宠物朋友圈</h2>
      <p class="social-description">分享你的宠物日常，结识更多志同道合的宠友！</p>
      
      <div class="social-grid">
        <div class="social-card">
          <img src="@/assets/1.png" alt="宠物分享" />
          <div class="social-meta">
            <span class="social-user">@猫咪爱好者</span>
            <span class="social-likes">❤️ 128</span>
          </div>
        </div>
        
        <div class="social-card">
          <img src="@/assets/2.png" alt="宠物分享" />
          <div class="social-meta">
            <span class="social-user">@狗狗之家</span>
            <span class="social-likes">❤️ 95</span>
          </div>
        </div>
        
        <div class="social-card">
          <img src="@/assets/Hero.png" alt="宠物分享" />
          <div class="social-meta">
            <span class="social-user">@小兔乖乖</span>
            <span class="social-likes">❤️ 76</span>
          </div>
        </div>
        
        <div class="social-card">
          <img src="@/assets/3.png" alt="宠物分享" />
          <div class="social-meta">
            <span class="social-user">@宠物乐园</span>
            <span class="social-likes">❤️ 156</span>
          </div>
        </div>
      </div>
      
      <div class="social-action">
        <a href="/social" class="banner-button">加入社区</a>
      </div>
    </section>

    <!-- 会员福利区 -->
    <section class="membership-benefits">
      <div class="benefits-content">
        <h2>加入会员，享受专属福利</h2>
        <p>成为会员，获取宠物护理专家咨询、专属宠物用品折扣和个性化饲养建议</p>
        <router-link to="/member-center" class="banner-button">立即加入</router-link>
      </div>
    </section>
  </main>
</template>

<style scoped>
/* 全局样式变量 */
:root {
  --primary-color: #4CAF50;
  --primary-hover: #3d8b40;
  --text-primary: #333;
  --text-secondary: #666;
  --white: #ffffff;
  --light-gray: #f5f5f5;
  --radius: 12px;
  --transition: all 0.3s ease;
  --shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

/* 首页样式 */
.home-page {
  min-height: 100vh;
}

/* 英雄横幅 */
.hero-banner {
  position: relative;
  height: 500px;
  overflow: hidden;
  margin-bottom: 40px;
}

.banner-image {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: -1;
}

.banner-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.banner-content {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  text-align: center;
  color: var(--white);
  background-color: rgba(0, 0, 0, 0.5);
  padding: 40px;
  border-radius: var(--radius);
  max-width: 800px;
  width: 90%;
}

.banner-content h1 {
  font-size: 48px;
  font-weight: 700;
  margin: 0 0 20px 0;
  line-height: 1.2;
  text-transform: uppercase;
}

.banner-content p {
  font-size: 20px;
  margin: 0 0 30px 0;
  line-height: 1.5;
}

.banner-button {
  display: inline-block;
  background-color: var(--primary-color);
  color: var(--white);
  padding: 16px 32px;
  border-radius: var(--radius);
  font-size: 18px;
  font-weight: 600;
  text-decoration: none;
  transition: var(--transition);
  text-transform: uppercase;
}

.banner-button:hover {
  background-color: var(--primary-hover);
  transform: translateY(-2px);
}

/* 响应式设计 */
@media (max-width: 768px) {
  .hero-banner {
    height: 400px;
  }
  
  .banner-content h1 {
    font-size: 32px;
  }
  
  .banner-content p {
    font-size: 16px;
  }
  
  .banner-button {
    font-size: 16px;
    padding: 14px 28px;
  }
}

@media (max-width: 480px) {
  .hero-banner {
    height: 300px;
  }
  
  .banner-content {
    padding: 24px;
  }
  
  .banner-content h1 {
    font-size: 24px;
    margin-bottom: 16px;
  }
  
  .banner-content p {
    font-size: 14px;
    margin-bottom: 20px;
  }
  
  .banner-button {
    font-size: 14px;
    padding: 12px 24px;
  }
}

/* 宠物品种展示区 */
.breeds-showcase {
  padding: 60px 20px;
  max-width: 1200px;
  margin: 0 auto;
}

.breeds-showcase h2 {
  text-align: center;
  font-size: 2.2rem;
  margin-bottom: 40px;
  color: var(--text-primary);
}

.breeds-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 30px;
}

.breed-card {
  background: var(--white);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  transition: var(--transition);
}

.breed-card:hover {
  transform: translateY(-8px);
  box-shadow: 0 12px 20px rgba(0, 0, 0, 0.12);
}

.breed-card img {
  width: 100%;
  height: 250px;
  object-fit: cover;
}

.breed-info {
  padding: 25px;
}

.breed-info h3 {
  font-size: 1.5rem;
  margin-bottom: 10px;
  color: var(--primary-color);
}

.breed-info p {
  color: var(--text-secondary);
  margin-bottom: 20px;
}

.breed-link {
  display: inline-block;
  color: var(--primary-color);
  font-weight: 600;
  text-decoration: none;
  padding: 8px 16px;
  border: 2px solid var(--primary-color);
  border-radius: 25px;
  transition: var(--transition);
}

.breed-link:hover {
  background-color: var(--primary-color);
  color: var(--white);
}

/* 养宠指南区域 */
.pet-guides {
  padding: 60px 20px;
  max-width: 1200px;
  margin: 0 auto;
  background-color: var(--light-gray);
}

.pet-guides h2 {
  text-align: center;
  font-size: 2.2rem;
  margin-bottom: 40px;
  color: var(--text-primary);
}

.guides-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 30px;
}

.guide-card {
  background: var(--white);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  transition: var(--transition);
}

.guide-card:hover {
  transform: translateY(-8px);
  box-shadow: 0 12px 20px rgba(0, 0, 0, 0.12);
}

.guide-card img {
  width: 100%;
  height: 250px;
  object-fit: cover;
}

.guide-info {
  padding: 25px;
}

.guide-info h3 {
  font-size: 1.5rem;
  margin-bottom: 10px;
  color: var(--primary-color);
}

.guide-info p {
  color: var(--text-secondary);
  margin-bottom: 20px;
}

/* 宠物故事专栏 */
.pet-stories {
  padding: 60px 20px;
  max-width: 1200px;
  margin: 0 auto;
}

.stories-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 40px;
  padding: 0 20px;
}

.stories-header h2 {
  font-size: 2.2rem;
  color: var(--text-primary);
  margin: 0;
}

.view-all {
  color: var(--primary-color);
  font-weight: 600;
  text-decoration: none;
  transition: var(--transition);
}

.view-all:hover {
  text-decoration: underline;
}

.stories-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
  gap: 30px;
}

.story-card {
  display: flex;
  background: var(--white);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  transition: var(--transition);
}

.story-card:hover {
  transform: translateY(-8px);
  box-shadow: 0 12px 20px rgba(0, 0, 0, 0.12);
}

.story-image {
  width: 150px;
  height: 150px;
  flex-shrink: 0;
}

.story-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.story-content {
  padding: 20px;
  flex: 1;
}

.story-content h3 {
  font-size: 1.2rem;
  margin-bottom: 10px;
  color: var(--text-primary);
}

.story-excerpt {
  color: var(--text-secondary);
  font-size: 0.95rem;
  margin-bottom: 15px;
  line-height: 1.4;
}

.story-meta {
  display: flex;
  justify-content: space-between;
  font-size: 0.85rem;
  color: #999;
}

/* 像素风格宠物展示区 */
.pixel-pets-showcase {
  padding: 60px 20px;
  max-width: 1200px;
  margin: 40px auto;
  background-color: #f9f9f9;
  border-radius: var(--radius);
}

.pixel-pets-showcase h2 {
  text-align: center;
  font-size: 2.2rem;
  margin-bottom: 30px;
  color: var(--text-primary);
}

.pixel-gallery-wrapper {
  position: relative;
  width: 100%;
}

.pixel-gallery {
  display: flex;
  gap: 30px;
  overflow-x: auto;
  padding: 20px 0;
  scroll-behavior: smooth;
  -webkit-overflow-scrolling: touch;
}

/* 隐藏滚动条但保留功能 */
.pixel-gallery::-webkit-scrollbar {
  display: none;
}

.pixel-gallery {
  -ms-overflow-style: none;
  scrollbar-width: none;
}

.pixel-item {
  flex-shrink: 0;
  width: 300px;
  text-align: center;
  transition: var(--transition);
}

.pixel-item:hover {
  transform: translateY(-5px);
}

.pixel-item img {
  width: 100%;
  height: auto;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  transition: var(--transition);
}

.pixel-item img:hover {
  box-shadow: 0 15px 30px rgba(0, 0, 0, 0.15);
}

.pixel-caption {
  margin-top: 15px;
  font-size: 1rem;
  color: var(--text-secondary);
  font-weight: 500;
}

.scroll-hint {
  text-align: center;
  margin-top: 20px;
  font-size: 0.9rem;
  color: #999;
}

/* 宠物档案管理 */
.pet-profile {
  padding: 60px 20px;
  background-color: var(--primary-color);
  color: var(--white);
  margin: 40px 0;
}

.profile-content {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 40px;
}

.profile-text {
  flex: 1;
}

.profile-text h2 {
  font-size: 2.2rem;
  margin-bottom: 20px;
}

.profile-text p {
  font-size: 1.1rem;
  margin-bottom: 20px;
  line-height: 1.6;
}

.profile-features {
  list-style: none;
  padding: 0;
  margin-bottom: 30px;
}

.profile-features li {
  font-size: 1.1rem;
  margin-bottom: 10px;
  display: flex;
  align-items: center;
}

.profile-image {
  flex: 1;
  max-width: 500px;
}

.profile-image img {
  width: 100%;
  border-radius: var(--radius);
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
}

/* 宠物动态分享 */
.pet-social {
  padding: 60px 20px;
  max-width: 1200px;
  margin: 0 auto;
  text-align: center;
}

.pet-social h2 {
  font-size: 2.2rem;
  margin-bottom: 15px;
  color: var(--text-primary);
}

.social-description {
  font-size: 1.1rem;
  color: var(--text-secondary);
  margin-bottom: 40px;
}

.social-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 20px;
  margin-bottom: 40px;
}

.social-card {
  position: relative;
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  transition: var(--transition);
}

.social-card:hover {
  transform: translateY(-8px);
  box-shadow: 0 12px 20px rgba(0, 0, 0, 0.12);
}

.social-card img {
  width: 100%;
  height: 200px;
  object-fit: cover;
}

.social-meta {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: rgba(0, 0, 0, 0.7);
  color: var(--white);
  padding: 10px 15px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.9rem;
}

.social-action {
  margin-top: 30px;
}

/* 会员福利区 */
.membership-benefits {
  background-color: var(--light-gray);
  padding: 80px 20px;
  text-align: center;
  margin-top: 60px;
}

.benefits-content h2 {
  font-size: 2.2rem;
  margin-bottom: 20px;
  color: var(--primary-color);
}

.benefits-content p {
  font-size: 1.1rem;
  max-width: 700px;
  margin: 0 auto 30px;
  color: var(--text-secondary);
}

/* 响应式设计补充 */
@media (max-width: 992px) {
  .profile-content {
    flex-direction: column;
    text-align: center;
  }
  
  .stories-header {
    flex-direction: column;
    gap: 20px;
    text-align: center;
  }
}

@media (max-width: 768px) {
  .story-card {
    flex-direction: column;
  }
  
  .story-image {
    width: 100%;
    height: 200px;
  }
  
  .pixel-item {
    width: 250px;
  }
}

@media (max-width: 480px) {
  .stories-grid {
    grid-template-columns: 1fr;
  }
  
  .social-grid {
    grid-template-columns: 1fr;
  }
  
  .pixel-item {
    width: 200px;
  }
}
</style>
